import { AsyncComponentLoader } from "vue";

const modulesMeta = import.meta.glob<false,string,AsyncComponentLoader>('../views/**/*.vue',)
export function getModules() {
  const entries = Object.entries(modulesMeta).map(([path, module]) => {
    const fmtdPath = path.replace(/^\.\.\/views(.*).vue/, '$1')
    return [fmtdPath, module]
  })
  const obj:Record<string,AsyncComponentLoader>= Object.fromEntries(entries)
  return obj
}
